package ca.compsci.opent.compiler.semantics;

public class Variable extends TypedSymbol {
	private boolean initialized = false, usedAsRValue = false;
	private int id;
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Variable(Type t, boolean initialized) {
		setType(t);
		setInitialized(initialized);
	}
	
	// Here initialised refers to whether or not a variable has been
	// assigned a value
	public boolean isInitialized() {
		return initialized;
	}

	void setInitialized(boolean initialized) {
		this.initialized = initialized;
	}
	
	public boolean wasUsedAsRValue() {
		return usedAsRValue;
	}
	
	void setUsedAsRValue(boolean t) {
		usedAsRValue = t;
	}
}
